package cn.edu.buaa.nlsde.grid.Structure;

import java.util.ArrayList;
import java.util.List;

public class Cluster
{
	public int clusterID;
	public String clusterName;
	private String localTime;
	private String owner;
	private String latlong;
	private String url;
	private String clusterIP;
	private String clusterDesc;
	public List<Host> hosts;
	
	public Cluster()
	{
		hosts = new ArrayList<Host>();
	}
	public Cluster(List<Host> hosts)
	{
		this.hosts=hosts;
	}
	
	public int getID()
	{
		return clusterID;
	}
	public void setID(int clusterID)
	{
		this.clusterID=clusterID;
	}

	public List<Host> getHosts()
	{
		return hosts;
	}
	public void setHosts(List<Host> hosts)
	{
		this.hosts=hosts;
	}
	public Host getHost(String hostName)
	{
		Host host=null;
		List<Host> hosts=this.getHosts();
		for(int i=0;i<hosts.size();i++)
		{
			Host myhost=(Host)hosts.get(i);
			if(myhost.getName().equals(hostName))
			{
				host=myhost;
				break;
			}
		}
		return host;
	}

	public String getName()
	{
		return clusterName;
	}
	public void setName(String clusterName)
	{
		this.clusterName=clusterName;
	}

	public String getLocalTime()
	{
		return localTime;
	}
	public void setLocalTime(String localTime)
	{
		this.localTime=localTime;
	}

	public String getLatlong()
	{
		return latlong;
	}
	public void setLatlong(String latlong)
	{
		this.latlong=latlong;
	}

	public String getOwner()
	{
		return owner;
	}
	public void setOwner(String owner)
	{
		this.owner=owner;
	}

	public String getURL()
	{
		return url;
	}
	public void setURL(String url)
	{
		this.url=url;
	}

	public String getClusterDesc()
	{
		return clusterDesc;
	}
	public void setClusterDesc(String clusterDesc)
	{
		this.clusterDesc=clusterDesc;
	}

	public String getClusterIP()
	{
		return clusterIP;
	}
	public void setClusterIP(String clusterIP)
	{
		this.clusterIP=clusterIP;
	}

}
